package com.yunyouyi.intelligent_vehicle.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunyouyi.intelligent_vehicle.dto.LoginDTO;
import com.yunyouyi.intelligent_vehicle.entity.User;
import com.yunyouyi.intelligent_vehicle.mapper.UserMapper;

import com.yunyouyi.intelligent_vehicle.service.UserService;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
    @Override
    public User login(LoginDTO loginDTO) {
        User user = baseMapper.selectOne(new QueryWrapper<User>().eq("account", loginDTO.getAccount()));
        if (user != null && user.getPassword().equals(loginDTO.getPassword())) {
            return user;
        }
        return null;
    }
    // 实现自定义业务方法
}